<?php
declare(strict_types=1);

namespace ServerApp\lib\server\web_socket;

use Swoole\Websocket\Server;

/**
 *
 */
interface IWebSocket
{
    /**
     * @param $server
     * @param $fd
     * @param $path
     */
    public function open(Server $server, int $fd, string $path): void;

    /**
     * @param $server
     * @param $fd
     * @param $data
     */
    public function message(Server$server, int $fd, string $data): void;

    /**
     * @return string
     */
    public function getName(): string;

    /**
     * @param string $data
     */
    public function task(string $data): void;

    /**
     * @param $to
     * @param $mid
     * @param $data
     */
    public function udpReceiver($to, $mid, $data): void;
}